<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@include file="/common/mytags.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>管理员个人信息</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/css/gobal.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>common/css/animate.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>backstage/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>backstage/css/createActive.css" media="all">
    <style type="text/css">
        img{
            cursor: pointer;
            height: 200px;
            width: 200px;
            border-radius:200px;
            margin-top: 10px;
            margin-left: 10px;
        }
        .user-info{
            float: left;
        }
        .info-rigth{
            margin-left: 50px;
            width: 58%;
            margin-top: 20px;
        }
        .row-content {
            padding: 0 10px;
            margin-bottom: 20px;
            box-shadow: 1px 1px 10px 1px rgba(198, 219, 224, .6);
            border-radius: 5px;
        }
        .row-content-item {
            height: 60px;
            line-height: 60px;
            border-bottom: 1px solid #eee;
            color: #888;
            font-size: 26px;
        }
        .border-none {
            border-bottom: 0;
        }
    </style>
</head>




<body>


<div class="larry-fluid larry-wrapper" id="main">


    <div class="layui-row lay-col-space20" >
        <div class="layui-cos-xs12 layui-col-sm12 layui-col-md12 layui-col-lg8">
            <section class="larry-body animated ">
               <div class="user-info">
                    <div class="photo ">
                        <c:if test="${empty requestScope.user.pic }">
                            <img class="layui-anim-rotate"  src="<%=basePath%>backstage/images/user.jpg" alt="用户头像" title="用户头像">
                        </c:if>
                        <c:if test="${not empty requestScope.user.pic}">
                            <img  class="layui-anim-rotate" src="${requestScope.user.pic}" alt="用户头像" title="用户头像">
                        </c:if>
                    </div>
               </div>
                <div class="user-info info-rigth">
                    <div class="row-content layui-anim-up">
                        <div class="row-content-item">
                            <span style="float: left">昵称</span>
                            <span style="float: right">${requestScope.user.name}</span>
                        </div>
                        <div class="row-content-item">
                            <span style="float: left">账号</span>
                            <span style="float: right">${requestScope.user.phone}</span>
                        </div>
                        <div class="row-content-item border-none">
                            <span style="float: left">角色</span>
                            <span style="float: right">${requestScope.user.role}</span>
                        </div>
                    </div>
               </div>
            </section>
        </div>
    </div>
</div>
<script type="text/javascript" src="<%=basePath%>common/frame/layui/layui.js"></script>
</body>

<script type="text/javascript">


    layui.config({
        base: "<%=basePath%>/common/larrylib/",
        version: true
    }).use(["jquery", "common", "layer", "form", "larryMenu"], function () {

        var $ = layui.jquery;
        var r = layui.$, t = layui.layer, form = layui.form, e = layui.common;
        var i = layui.device();
       
        //提交注册
        form.on("submit(updpwd)", function (data) {
            var loginLoading = layer.msg('密码修改中，请稍候', {icon: 16, time: false, shade: 0.8});
            var pwd = $("#newpwd").val();
            var repwd = $("#renewpwd").val();
            if(repwd!=pwd){
            	layer.msg("两次密码输入不一致！", {icon: 5});
            	$("input[id='renewpwd']").focus();
            	return ;
            }
            $.ajax({
                url: '<%=basePath%>user/do/update/pwd',
                type: 'post',
                async: false,
                data: data.field,
                dataType: "json",
                success: function (data) {
                    if (data.state == 200) {
                        layer.close(loginLoading);
                        layer.msg(data.message, {icon: 6});
                        window.setInterval(function(){
                            var index = parent.layer.getFrameIndex(window.name); //当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                            return true;
                        },3000);

                    } else {
                        layer.msg(data.message, {icon: 5});
                        layer.close(loginLoading);
                        return false;
                    }

                }, error: function () {
                    layer.close(loginLoading);
                    layer.msg("系统数据处理异常！", {icon: 2});
                }
            });

           
        });
        
       
    
    }) ;
    
   <%--  --%>
</script>
</html>